<template>
  <div class="wfull">
    <a-empty v-if="obj===null"></a-empty>
    <a-form v-else :labelCol="{ span: 4 }" :wrapperCol="{ span: 20 }">
      <a-form-item label="流程名称">
        {{ obj.name }}
      </a-form-item>
      <a-form-item label="流程编号">
        {{ obj.code }}
      </a-form-item>
      <a-form-item label="流程版本">
        {{ obj.version }}
      </a-form-item>
      <a-form-item label="流程类型">
        <ZgDicHolder parentCode="flowType" :code="obj.type"></ZgDicHolder>
      </a-form-item>
      <a-form-item label="流程分类">
        <ZgDicHolder parentCode="flowCategory" :code="obj.category"></ZgDicHolder>
      </a-form-item>
      <a-form-item label="是否发布">
        <a-tag v-if="obj.isPublish" color="blue">是</a-tag>
        <a-tag v-else color="red">否</a-tag>
      </a-form-item>
      <a-form-item label="后续流程编号">
        {{ obj.nextCode }}
      </a-form-item>
    </a-form>
  </div>
</template>
<script>
import { dic } from './dic'
export default {
  props: {
    obj: {
      type: Object,
      default: () => {
        return null
      }
    }
  },
  data () {
    return {
      dic
    }
  },
  methods: {
    getOptLabel (opts, value) {
      const arr = opts.filter(t => {
        return t.value === value
      })
      if (arr.length > 0) {
        return arr[0].label
      } else {
        return ''
      }
    }
  }
}
</script>

<style lang="scss" scoped>
</style>
